/**
 * 
 */
package fr.cephb.operonj.core.db.comparator;

import java.io.Serializable;
import java.util.Comparator;

import com.sleepycat.bind.tuple.IntegerBinding;
import com.sleepycat.bind.tuple.TupleInput;


/**
 * @author pierre
 *
 */
public class IntComparator
	implements Comparator<byte[]>,Serializable
	{
	private static final long serialVersionUID = 1L;
	public IntComparator()
		{
		}
	
	@Override
	public int compare(byte[] o1, byte[] o2)
		{
		IntegerBinding binding= new IntegerBinding();
		Integer t1= binding.entryToObject(new TupleInput(o1));
		Integer t2= binding.entryToObject(new TupleInput(o2));
		return t1.compareTo(t2);
		}
	}
